package com.project.communitymanagement.controller;

import com.project.communitymanagement.common.BaseController;
import com.project.communitymanagement.common.Page;
import com.project.communitymanagement.common.ResponseEntity;
import com.project.communitymanagement.entity.Remind;
import com.project.communitymanagement.service.RemindService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ProjectName: epidemic-prevention-backend
 * @Package: com.project.communitymanagement.controller
 * @ClassName: RemindController
 * @Author: "XGP"
 * @Description:
 * @Date: 2022/04/11 11:19
 * @Version: 1.0
 */
@RestController
@CrossOrigin
@RequestMapping("remind")
public class RemindController extends BaseController<RemindService, Remind> {

    @Autowired
    private RemindService remindService;

    @Override
    protected RemindService service() {
        return remindService;
    }

    @PostMapping("getAll")
    public ResponseEntity<List<Remind>> getAll() {
        return ResponseEntity.success(remindService.getAll());
    }

    @PostMapping("haveRead")
    public ResponseEntity<Integer> haveRead(@RequestBody List<Remind> list) {
        return ResponseEntity.success(remindService.haveRead(list));
    }
}

